package com.spring5.learning.optional;

/**
 * @author xin
 * @version 1.0
 */
public class Address {

    private String province;

    private String city;

    private String area;

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }


    static class Builder {
        private Address address = new Address();

        public Builder city(String city) {
            address.setCity(city);
            return this;
        }

        public Builder province(String province) {
            address.setProvince(province);
            return this;
        }

        public Builder area(String area) {
            address.setArea(area);
            return this;
        }

        public Address address() {
            return address;
        }
    }
}
